<layout name='Layout/layout_main' />
<script type="text/javascript" src="__PUBLIC__/editor/kindeditor.js"></script>
<script type="text/javascript" src="__PUBLIC__/editor/kindeditor.setting.js"></script>
<script type="text/javascript">
	function popup_actor(){
		winopen("{:U("popup/actor")}",730,574);
	}
function save() {
editor.sync();
$("#actor").val("");
$("#actor_wrap div.address_list span").each(function() {
$("#actor").val($("#actor").val() + $(this).text().replace(';', '') + '|' + $(this).attr("title") + ";")
})
if (check_form("form_data")) {
sendForm("form_data", "{:U('save')}");
}
}

$(document).ready(function() {
editor_init();
fill_time("start_time");
fill_time("end_time");

$(function(){
$(".input-date").datepicker();
$("#priority").val(3);
$("#slider-range-priority").slider({
range : "min",
min : 1,
max : 5,
value : 3,
slide : function(event, ui) {
$("#priority").val(ui.value);
$("div.slider_box div.ui-slider").css( "background-color", schedule_bg(ui.value));
$("div.slider_box div.ui-widget-header").css("background-color", schedule_bg(ui.value));
}
});
$("div.slider_box div.ui-slider").css( "background-color", schedule_bg(3));
$("div.slider_box div.ui-widget-header").css("background-color", schedule_bg(3));
})
});
function month_view() {
window.open("__URL__", "_self");
}
</script>

<div class="title panel panel-default">
	<div class="panel-body">
		<h3 class="col-md-12">新建日历事项</h3>
	</div>
</div>
<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"  class="well form-horizontal">
	<input type="hidden" id="ajax" name="ajax" value="0">
	<input type="hidden" id="add_file" name="add_file">
	<input type="hidden" id="opmode" name="opmode" value="add">
	<input type="hidden" name="actor" id="actor">
	<div class="form-group">
		<label class="col-md-2 control-label" for="name">主题*：</label>
		<div class="col-md-10">
			<input class="form-control" type="text" id="name" name="name" check="require" msg="请输入主题">
		</div>
	</div>

	<div class="form-group col-md-6">
		<label class="col-md-4 control-label" for="name">开始时间*：</label>
		<div class="col-md-8">
			<input type="text" id="start_date" name="start_date" readonly="readonly" class="form-control input-date"   check="require" msg="请输入开始日期">
			<select id="start_time" name="start_time" class="form-control"></select>
		</div>
	</div>

	<div class="form-group col-md-6">
		<label class="col-md-4 control-label" for="name">结束时间*：</label>
		<div class="col-md-8">
			<input type="text" id="end_date" name="end_date" readonly="readonly"
			class="form-control input-date" check="require" msg="请输入结束日期">
			<select id="end_time" name="end_time" class="form-control "></select>
		</div>
	</div>

	<div class="form-group col-md-6">
		<label class="col-md-4 control-label" for="location">地点：</label>
		<div class="col-md-8">
			<input class="form-control" type="text" id="location" name="location">
		</div>
	</div>

	<div class="form-group col-md-6">
		<label class="col-md-4 control-label" for="location">优先级：</label>
		<div class="col-md-8">
			<div class="form-control-static" >
				<input type="hidden" id="priority" name="priority"/>
				<div  class="slider_box" >
					<div class="left" >
						低
					</div>
					<div id="slider-range-priority"></div>
					<div class="right" >
						高
					</div>
				</div>
			</div>
		</div>
	</div>

	<div class="form-group">
		<label class="col-md-2 control-label" for="location">参与人员：</label>
		<div class="col-md-10">
			<div id="actor_wrap" class="inputbox">
				<a class="pull-right btn btn-link text-center" onclick="popup_actor();"> <i class="icon-user"></i> </a>
				<div class="wrap" >
					<span class="address_list"></span>
					<span class="text" >
						<input class="letter" type="text"  >
					</span>
				</div>
				<div class="search dropdown ">
					<ul class="dropdown-menu"></ul>
				</div>
			</div>
		</div>
	</div>

	<div class="form-group">
		<label class="col-md-2 control-label" >附件：</label>
		<div class="col-md-10">
			<include file="Layout:uploader" />
		</div>
	</div>

	<div class="form-group">
		<div class="col-md-12">
			<textarea id="content" name="content" style="width:100%;height:300px;"></textarea>
		</div>
	</div>

	<div class="action">
		<input class="btn btn-default" type="button" value="保存" onclick="save();">
		<input  class="btn btn-default" type="button" value="取消" onclick="go_return_url();">
	</div>
</form>